package controllers

import (
	"github.com/beego/beego/v2/server/web"
	"quickConnect/models/globalValues"
)

type CheckController struct {
	web.Controller
}

func (c CheckController) Get() {
	if c.Ctx.Input.Host() != "localhost" || c.Ctx.Input.Domain() != "localhost" {
		c.Ctx.WriteString("非法访问")
	}
	status := struct {
		Status bool `json:"status"`
	}{globalValues.Enable}
	c.Data["json"] = &status
	_ = c.ServeJSON()
}
